
import gevent
import time

def f(n):
    for i in range(n):
        print(gevent.getcurrent(),i)
        # time.sleep(0.5)
        gevent.sleep(0.5)

print("----1-----")
g1 = gevent.spawn(f,5)
print("----2-----")
g2 = gevent.spawn(f,6)
print("----3-----")
g3 = gevent.spawn(f,7)
print("----4-----")

g1.join()
print("----5-----")
g2.join()
print("----6-----")
g3.join()
print("----7-----")
